package com.weimengchao.task.domain;

import com.weimengchao.task.tool.POITool;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;

/**
 * 常用样式
 */
public class CommonStyles {

    /**
     * 默认白色
     */
    private CellStyle defalutStyle;

    /**
     * 黄色
     */
    private CellStyle warning;

    /**
     * 浅黄色
     */
    private CellStyle tips;

    /**
     * 灰色
     */
    private CellStyle grey;

    /**
     * 货币
     */
    private CellStyle currency;

    /**
     * 货币,浅黄色
     */
    private CellStyle currencyTips;

    /**
     * 货币,灰色
     */
    private CellStyle currencyGrey;

    /**
     * 日期1 yy/d/m h:mm
     */
    private CellStyle date1;

    public CommonStyles(SXSSFWorkbook workbook) {
        defalutStyle = POITool.createCellStyle(workbook, false, Formats.General.getFormat(), null);
        warning = POITool.createCellStyle(workbook, false, Formats.General.getFormat(), IndexedColors.YELLOW);
        tips = POITool.createCellStyle(workbook, false, Formats.General.getFormat(), IndexedColors.LIGHT_YELLOW);
        grey = POITool.createCellStyle(workbook, false, Formats.General.getFormat(), IndexedColors.GREY_25_PERCENT);
        currency = POITool.createCellStyle(workbook, false, Formats.Currency1.getFormat(), IndexedColors.WHITE1);
        currencyTips = POITool.createCellStyle(workbook, false, Formats.Currency1.getFormat(), IndexedColors.LIGHT_YELLOW);
        currencyGrey = POITool.createCellStyle(workbook, false, Formats.Currency1.getFormat(), IndexedColors.GREY_25_PERCENT);
        date1 = POITool.createCellStyle(workbook, false, Formats.date1.getFormat(), null);
    }

    public CellStyle getDefalutStyle() {
        return defalutStyle;
    }

    public CellStyle getWarning() {
        return warning;
    }

    public CellStyle getTips() {
        return tips;
    }

    public CellStyle getGrey() {
        return grey;
    }

    public CellStyle getCurrency() {
        return currency;
    }

    public CellStyle getCurrencyTips() {
        return currencyTips;
    }

    public CellStyle getCurrencyGrey() {
        return currencyGrey;
    }

    public CellStyle getDate1() {
        return date1;
    }
}
